﻿using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;


namespace AnyOffice.general.system.attend
{
    public partial class duty : ModulePage  
    {
        public string GetGeneralName(string general)
        {
            string str = string.Empty;
            general = general + "," + general + ",";
            if (general.IndexOf(",1,") >= 0)
            {
                str = str + "星期一,";
            }
            if (general.IndexOf(",2,") >= 0)
            {
                str = str + "星期二,";
            }
            if (general.IndexOf(",3,") >= 0)
            {
                str = str + "星期三,";
            }
            if (general.IndexOf(",4,") >= 0)
            {
                str = str + "星期四,";
            }
            if (general.IndexOf(",5,") >= 0)
            {
                str = str + "星期五,";
            }
            if (general.IndexOf(",6,") >= 0)
            {
                str = str + "星期六,";
            }
            if (general.IndexOf(",0,") >= 0)
            {
                str = str + "星期日,";
            }
            if (str.EndsWith(","))
            {
                str = str.Substring(0, str.Length - 1);
            }
            return str;
        }
        public bool IsUsed(int dutyTypeId)
        {
            return new AttendConfigDao().IsUsed(base.Conn, dutyTypeId);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable table = new AttendConfigDao().SelectAll(base.Conn);
            if (table.Rows.Count > 0)
            {
                this.rptConfig.DataSource = table;
                this.rptConfig.DataBind();
            }
        }
 

    }
}
